package a.f.j;

import a.c.bb;
import a.c.d;
import a.c.e;
import a.c.m;
import a.c.q;
import a.c.w;
import a.c.x;
import a.f.*;
import a.i.t;

import java.util.ArrayList;
import java.util.Comparator;

import a.f.j.v;
import a.f.j.cb;
import a.f.j.s;
import a.i.t;

public class r
  implements s
{
  protected a_ a = new a_();
  protected b_ b = new b_();
  protected c_ c = new c_();
  protected cb d;
  protected q e;
  protected boolean f = false;
  protected eb g = new eb();
  protected a.c.n h = new t()
  {
    public int getInt(Object paramAnonymousObject)
    {
      return 1;
    }
  };
  protected d i = null;
  protected e j = null;
  protected a.c.ab k;
  protected e l = null;
  protected e m = null;
  private int n = 50;
  private boolean o;
  public static boolean p;
  
  public void a(boolean paramBoolean)
  {
    this.o = paramBoolean;
  }
  
  public boolean f()
  {
    return this.o;
  }
  
  public void a(int paramInt)
  {
    this.n = paramInt;
  }
  
  public int g()
  {
    return this.n;
  }
  
  public a.c.ab b()
  {
    if ((ab.g) || (this.f)) {
      return this.k;
    }
    throw new RuntimeException("Invalid Execution Order: call 'createPlanarization' first!");
  }
  
  public e e()
  {
    if ((ab.g) || (this.f)) {
      return this.l;
    }
    throw new RuntimeException("Invalid Execution Order: call 'assignUpward' first!");
  }
  
  public e d()
  {
    if ((ab.g) || (this.f)) {
      return this.m;
    }
    throw new RuntimeException("Invalid Execution Order: call 'assignUpward' first!");
  }
  
  public void a(cb paramcb)
  {
    boolean bool = ab.g;
    this.d = paramcb;
    this.e = paramcb.a();
    if (!bool)
    {
      if (this.e.k() != 0)
      {
        if (bool) {
          break label94;
        }
        if (this.e.m() != 0) {}
      }
      else
      {
        this.k = new a.c.ab();
      }
    }
    else
    {
      this.f = true;
      return;
    }
    this.g.a(this.e);
    this.g.a(this.o);
    label94:
    int[] arrayOfInt = new int[this.e.j()];
    v localv = new v(this.e, this.h);
    bb localbb = a(arrayOfInt, localv);
    localv.a(localbb, arrayOfInt);
    this.k = localv.c();
    x localx1 = this.e.B();
    x localx2 = this.e.B();
    a(localx1, localx2, localbb);
    a.c.ab localab1 = new a.c.ab(localv.a().iterator());
    a.c.ab localab2 = new a.c.ab(localv.b().iterator());
    a(localab1, localab2, localx1, localx2, arrayOfInt);
    this.e.a(localx1);
    this.e.a(localx2);
    paramcb.f();
    if (!bool)
    {
      if (this.i == null) {
        this.i = this.e.q();
      }
      paramcb.a(paramcb.c(this.i));
      this.f = true;
    }
    i();
  }
  
  protected bb a(int[] paramArrayOfInt, v paramv)
  {
    boolean bool = ab.g;
    int i4 = ab.f;
    Object localObject1 = new bb();
    Object localObject2 = null;
    if (!bool) {
      if (this.o)
      {
        i1 = 2147483647;
        int i2 = 0;
        label144:
        label146:
        label230:
        do
        {
          if (i2 >= this.n) {
            break;
          }
          if (i4 != 0) {
            break label326;
          }
          if (i1 <= 0) {
            break;
          }
          this.g.a((bb)localObject1);
          int i3 = 1;
          Object localObject3 = ((bb)localObject1).l();
          do
          {
            if (!((w)localObject3).e()) {
              break;
            }
            paramArrayOfInt[localObject3.d().f()] = (i3++);
            ((w)localObject3).f();
            if (bool) {
              break label146;
            }
            if (i4 != 0) {
              break label144;
            }
          } while (i4 == 0);
          paramv.a((bb)localObject1, paramArrayOfInt);
          if (!bool)
          {
            this.k = paramv.c();
            if ((!bool) && (i1 <= this.k.size())) {}
          }
          while (bool)
          {
            i1 = this.k.size();
            localObject2 = new bb();
            localObject3 = ((bb)localObject1).l();
            do
            {
              if (!((w)localObject3).e()) {
                break label230;
              }
              ((bb)localObject2).b(((w)localObject3).d());
              ((w)localObject3).f();
              if ((!bool) && (i4 != 0)) {
                break;
              }
            } while (i4 == 0);
          }
          localObject3 = this.k.l();
          if (((m)localObject3).e())
          {
            this.e.g(((m)localObject3).a());
            ((m)localObject3).f();
          }
          for (;;)
          {
            if (!bool) {
              if (i4 == 0)
              {
                if (i4 == 0) {
                  break;
                }
                if (bool) {
                  continue;
                }
                i2++;
              }
            }
          }
        } while (i4 == 0);
        localObject1 = localObject2;
        if (bool) {
          break label328;
        }
        break label325;
      }
    }
    this.g.a((bb)localObject1);
    localObject2 = localObject1;
    label325:
    label326:
    int i1 = 1;
    label328:
    w localw = ((bb)localObject2).l();
    if (localw.e())
    {
      paramArrayOfInt[localw.d().f()] = (i1++);
      if (!bool) {
        localw.f();
      }
    }
    else
    {
      for (;;)
      {
        if (i4 == 0)
        {
          if (i4 == 0) {
            break;
          }
          localw = ((bb)localObject1).l();
          localw.h();
          this.l = localw.d();
          localw.i();
          if (!bool) {
            this.m = localw.d();
          }
        }
      }
    }
    localw = ((bb)localObject1).l();
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale = localw.d();
      if (!bool) {
        if (locale.c() != 0)
        {
          this.j = locale;
          if (!bool) {
            if (i4 == 0) {
              break;
            }
          }
        }
        else
        {
          localw.f();
        }
      }
    } while (i4 == 0);
    return localObject1;
  }
  
  protected void a(x paramx1, x paramx2, bb parambb)
  {
    boolean bool = ab.g;
    int i1 = ab.f;
    w localw = parambb.l();
    e locale;
    do
    {
      do
      {
        if (!localw.e()) {
          break;
        }
        locale = localw.d();
        paramx1.a(locale, null);
        paramx2.a(locale, null);
        localw.f();
        if (bool) {
          break label93;
        }
        if (i1 != 0) {
          break label86;
        }
      } while (i1 == 0);
    } while (bool);
    localw = parambb.l();
    label86:
    label93:
    do
    {
      if (!localw.e()) {
        break;
      }
      locale = localw.d();
      a.c.v localv = parambb.d(locale);
      m localm = locale.l();
      do
      {
        do
        {
          if (!localm.e()) {
            break label269;
          }
          d locald = localm.a();
          if (i1 != 0) {
            break;
          }
          if (!bool) {
            if (locale != (e)parambb.a())
            {
              if (bool) {
                break label217;
              }
              if (locald.a(locale) == (e)parambb.d(localv).c())
              {
                paramx1.a(locale, locald);
                if (bool) {
                  continue;
                }
                if (i1 == 0) {
                  break label257;
                }
              }
            }
          }
          if ((bool) || ((locale != (e)parambb.d()) && (locald.a(locale) == (e)parambb.c(localv).c()))) {
            paramx2.a(locale, locald);
          }
          localm.f();
        } while (i1 == 0);
        localw.f();
      } while (bool);
    } while (i1 == 0);
    label217:
  }
  
  protected void a(a.c.ab paramab, x paramx)
  {
    boolean bool = ab.g;
    int i1 = ab.f;
    m localm = paramab.l();
    label116:
    label119:
    do
    {
      if (!localm.e()) {
        break;
      }
      d locald = localm.a();
      e locale1 = locald.e();
      e locale2 = locald.f();
      a.c.ab localab;
      if (!bool) {
        if (paramx.get(locale1) == null)
        {
          localab = new a.c.ab();
          localab.add(locald);
          if (bool) {
            break label119;
          }
          paramx.a(locale1, localab);
          if (i1 == 0) {
            break label116;
          }
        }
      }
      ((a.c.ab)paramx.get(locale1)).add(locald);
      if (!bool) {
        if (paramx.get(locale2) == null)
        {
          localab = new a.c.ab();
          localab.add(locald);
          paramx.a(locale2, localab);
          if (bool) {
            continue;
          }
          if (i1 == 0) {
            break label186;
          }
        }
      }
      ((a.c.ab)paramx.get(locale2)).add(locald);
      localm.f();
    } while (i1 == 0);
    label186:
  }
  
  protected void a(a.c.ab paramab1, a.c.ab paramab2, x paramx1, x paramx2, int[] paramArrayOfInt)
  {
    boolean bool = ab.g;
    int i1 = ab.f;
    x localx1 = this.e.B();
    x localx2 = this.e.B();
    a(paramab1, localx1);
    a(paramab2, localx2);
    h();
    this.b.a(paramArrayOfInt);
    this.c.a(paramArrayOfInt);
    w localw = this.e.v();
    label258:
    label421:
    label457:
    label495:
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale = localw.d();
      a.c.ab localab3 = new a.c.ab();
      a.c.ab localab2;
      d locald;
      m localm;
      do
      {
        a.c.ab localab1 = (a.c.ab)localx1.get(locale);
        if (i1 != 0) {
          return;
        }
        if (!bool) {
          if (localab1 != null)
          {
            this.b.a(locale);
            localab1.a(this.b);
          }
        }
        localab2 = (a.c.ab)localx2.get(locale);
        if (!bool) {
          if (localab2 != null)
          {
            this.c.a(locale);
            localab2.a(this.c);
          }
        }
        locald = (d)paramx1.get(locale);
        if ((bool) || (locald != null)) {
          if (locald.e() == locale)
          {
            if (bool) {
              break label258;
            }
            localab3.add(locald);
            if (i1 == 0) {}
          }
          else
          {
            localab3.add(this.d.b(locald));
          }
        }
        if (!bool) {
          if (localab1 != null)
          {
            localm = localab1.l();
            do
            {
              if (!localm.e()) {
                break;
              }
              locald = localm.a();
              if (i1 != 0) {
                break label421;
              }
              if (locald.e() == locale)
              {
                localab3.add(locald);
                if ((!bool) && (i1 == 0)) {}
              }
              else
              {
                localab3.add(this.d.b(locald));
              }
              if ((locale == this.j) && ((bool) || (this.i == null))) {
                this.i = ((d)localab3.d());
              }
              localm.f();
            } while (i1 == 0);
          }
        }
        locald = (d)paramx2.get(locale);
      } while (bool);
      if ((bool) || (locald != null)) {
        if (locald.e() == locale)
        {
          localab3.add(locald);
          if ((!bool) && (i1 == 0)) {
            break label457;
          }
        }
      }
      do
      {
        localab3.add(this.d.b(locald));
        if (locale == this.j)
        {
          if (!bool)
          {
            if (bool) {
              break;
            }
            if (this.i != null) {
              break label495;
            }
          }
          this.i = ((d)localab3.d());
        }
        if (localab2 != null)
        {
          localm = localab2.l();
          do
          {
            if (!localm.e()) {
              break label619;
            }
            locald = localm.a();
            if (i1 != 0) {
              break;
            }
            if (locald.e() == locale)
            {
              localab3.add(locald);
              if ((!bool) && (i1 == 0)) {}
            }
            else
            {
              localab3.add(this.d.b(locald));
            }
            if ((locale == this.j) && ((bool) || (this.i == null))) {
              this.i = ((d)localab3.d());
            }
            localm.f();
          } while (i1 == 0);
        }
        this.a.a(localab3);
        locale.b(this.a);
        localw.f();
      } while (bool);
    } while (i1 == 0);
    label619:
    this.e.a(localx1);
    if (!bool) {
      this.e.a(localx2);
    }
  }
  
  protected void h()
  {
    boolean bool = ab.g;
    int i1 = ab.f;
    a.c.ab localab = new a.c.ab(this.e.w());
    do
    {
      m localm = localab.l();
      while (i1 == 0)
      {
        if (!localm.e()) {
          break;
        }
        this.d.a(localm.a());
        localm.f();
      }
    } while (bool);
  }
  
  public void i() {}
  
  protected void a(int[] paramArrayOfInt)
  {
    int i1 = ab.f;
    a.i.n.a(0, "VERTEX ORDER");
    w localw = this.e.v();
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale = localw.d();
      a.i.n.a(0, "Node: " + locale + " index: " + paramArrayOfInt[locale.f()]);
      localw.f();
    } while (i1 == 0);
  }
  
  protected void a(ArrayList paramArrayList1, ArrayList paramArrayList2)
  {
    boolean bool = ab.g;
    int i2 = ab.f;
    a.i.n.a(0, "EDGE PARTITION RESULT");
    a.i.n.a(0, "SET ONE");
    int i1 = 0;
    if (i1 < paramArrayList1.size()) {}
    while (bool)
    {
      a.i.n.a(0, " edge: " + paramArrayList1.get(i1));
      i1++;
      if (bool) {
        break label89;
      }
      if (i2 != 0) {
        break label88;
      }
      if (i2 == 0) {
        break;
      }
    }
    a.i.n.a(0, "SET TWO");
    label88:
    label89:
    i1 = 0;
    if (i1 < paramArrayList2.size()) {}
    while (bool)
    {
      a.i.n.a(0, " edge: " + paramArrayList2.get(i1));
      i1++;
      if ((!bool) && (i2 != 0)) {
        break label154;
      }
      if (i2 == 0) {
        break;
      }
    }
    a.i.n.a(0, "HIDDEN EDGES");
    label154:
    do
    {
      m localm = this.k.l();
      while (i2 == 0)
      {
        if (!localm.e()) {
          break;
        }
        a.i.n.a(0, " edge: " + localm.a());
        localm.f();
      }
    } while (bool);
  }
  
  protected void a(a.c.ab paramab1, a.c.ab paramab2, int[] paramArrayOfInt)
  {
    boolean bool = ab.g;
    int i2 = ab.f;
    qb localqb = new qb();
    w localw = this.e.v();
    Object localObject2;
    do
    {
      if (!localw.e()) {
        break;
      }
      localObject1 = localw.d();
      localObject2 = new sb();
      ((sb)localObject2).b(20.0D, 20.0D);
      double d1 = paramArrayOfInt[localObject1.f()] * 40;
      ((sb)localObject2).a(d1, 0.0D);
      localqb.a(localObject1, (zc)localObject2);
      localw.f();
    } while (i2 == 0);
    Object localObject1 = paramab1.l();
    int i1;
    do
    {
      do
      {
        if (!((m)localObject1).e()) {
          break;
        }
        localObject2 = new pb();
        i1 = paramArrayOfInt[localObject1.a().f().f()] - paramArrayOfInt[localObject1.a().e().f()];
        ((pb)localObject2).a(paramArrayOfInt[localObject1.a().d()] * 40 + i1 * 20 + 10, -i1 * 20);
        localqb.a(((m)localObject1).a(), (zb)localObject2);
        ((m)localObject1).f();
        if (bool) {
          break label258;
        }
        if (i2 != 0) {
          break label251;
        }
      } while (i2 == 0);
    } while (bool);
    localObject1 = paramab2.l();
    label251:
    do
    {
      if (!((m)localObject1).e()) {
        break;
      }
      localObject2 = new pb();
      i1 = paramArrayOfInt[localObject1.a().f().f()] - paramArrayOfInt[localObject1.a().e().f()];
      ((pb)localObject2).a(paramArrayOfInt[localObject1.a().e().f()] * 40 + i1 * 20 + 10, i1 * 20);
      localqb.a(((m)localObject1).a(), (zb)localObject2);
      ((m)localObject1).f();
    } while (i2 == 0);
    label258:
  }
  
  protected void a(x paramx1, x paramx2, a.c.n paramn1, a.c.n paramn2)
  {
    boolean bool = ab.g;
    int i1 = ab.f;
    a.i.n.a(0, "INCIDENT EDGES");
    w localw = this.e.v();
    label250:
    do
    {
      do
      {
        if (!localw.e()) {
          return;
        }
        e locale = localw.d();
        a.i.n.a(0, " Node: " + locale + " ->: " + (d)paramn2.get(locale));
        a.i.n.a(0, " Node: " + locale + " <-: " + (d)paramn1.get(locale));
        a.c.ab localab = (a.c.ab)paramx1.get(locale);
        m localm;
        if (!bool)
        {
          if (localab != null)
          {
            localm = localab.l();
            do
            {
              if (!localm.e()) {
                break;
              }
              a.i.n.a(0, "  MIS1: Node: " + locale + " Edge: " + localm.a());
              localm.f();
              if ((!bool) && (i1 != 0)) {
                break label250;
              }
            } while (i1 == 0);
          }
          if (bool) {}
        }
        else
        {
          localab = (a.c.ab)paramx2.get(locale);
        }
        if ((bool) || (localab != null))
        {
          localm = localab.l();
          do
          {
            if (!localm.e()) {
              break;
            }
            a.i.n.a(0, "  MIS2: Node: " + locale + " Edge: " + localm.a());
            localm.f();
            if (bool) {
              break label352;
            }
            if (i1 != 0) {
              break label350;
            }
          } while (i1 == 0);
        }
      } while (bool);
      localw.f();
    } while (i1 == 0);
    label350:
    label352:
    return;
  }
  
  public static class a_
    implements Comparator
  {
    a.c.ab a;
    public static int b;
    
    public void a(a.c.ab paramab)
    {
      this.a = paramab;
    }
    
    public int compare(Object paramObject1, Object paramObject2)
    {
      d locald1 = (d)paramObject1;
      d locald2 = (d)paramObject2;
      return l.a(this.a.indexOf(locald1), this.a.indexOf(locald2));
    }
  }
  
  public static class c_
    implements Comparator
  {
    e a;
    int[] c;
    public static int d;
    
    public void a(e parame)
    {
      this.a = parame;
    }
    
    public void a(int[] paramArrayOfInt)
    {
      this.c = paramArrayOfInt;
    }
    
    public int compare(Object paramObject1, Object paramObject2)
    {
      boolean bool = ab.g;
      d locald1 = (d)paramObject1;
      d locald2 = (d)paramObject2;
      int i = this.c[this.a.f()];
      int j = this.c[locald1.a(this.a).f()];
      int k = this.c[locald2.a(this.a).f()];
      if (!bool) {
        if (j > i)
        {
          if (bool) {
            break label119;
          }
          if (k > i) {
            break label115;
          }
        }
      }
      if (!bool) {
        if (j < i)
        {
          if (bool) {
            break label149;
          }
          if (k < i)
          {
            label115:
            label119:
            if (!bool)
            {
              if (j > k) {
                return 1;
              }
              if (bool) {}
            }
            else if (j < k)
            {
              return -1;
            }
            return 0;
          }
        }
      }
      label149:
      if (!bool)
      {
        if (j > k) {
          return -1;
        }
        if (bool) {}
      }
      else if (j < k)
      {
        return 1;
      }
      return 0;
    }
  }
  
  public static class b_
    implements Comparator
  {
    e a;
    int[] c;
    public static boolean d;
    
    public void a(int[] paramArrayOfInt)
    {
      this.c = paramArrayOfInt;
    }
    
    public void a(e parame)
    {
      this.a = parame;
    }
    
    public int compare(Object paramObject1, Object paramObject2)
    {
      boolean bool = ab.g;
      d locald1 = (d)paramObject1;
      d locald2 = (d)paramObject2;
      int i = this.c[this.a.f()];
      int j = this.c[locald1.a(this.a).f()];
      int k = this.c[locald2.a(this.a).f()];
      if (!bool) {
        if (j > i)
        {
          if (bool) {
            break label119;
          }
          if (k > i) {
            break label115;
          }
        }
      }
      if (!bool) {
        if (j < i)
        {
          if (bool) {
            break label149;
          }
          if (k < i)
          {
            label115:
            label119:
            if (!bool)
            {
              if (j > k) {
                return -1;
              }
              if (bool) {}
            }
            else if (j < k)
            {
              return 1;
            }
            return 0;
          }
        }
      }
      label149:
      if (!bool)
      {
        if (j > k) {
          return 1;
        }
        if (bool) {}
      }
      else if (j < k)
      {
        return -1;
      }
      return 0;
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.j.r

 * JD-Core Version:    0.7.0.1

 */